package Dominio;

import javax.persistence.*;

import dto.TelefonoTO;
import hbt.PersistentObject;

@Entity
@Table(name="telefonos" )
public class Telefono extends PersistentObject {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	@Column(name="area",nullable=false, length=2)
	private String area;
	
	@Column(name="numero",nullable=false, length=12)
	private String numero;
	
	
	@ManyToOne
	@JoinColumn(name="idClientetitular")
	private Cliente titular;

	
	public String getArea() {
		return area;
	}
	public void setArea(String area) {
		this.area = area;
	}
	public String getNumero() {
		return numero;
	}
	public void setNumero(String numero) {
		this.numero = numero;
	}
	public TelefonoTO toTO() {
		return new TelefonoTO(this.area,this.numero);
	}
}

